package org.airline.dao;

import java.io.Serializable;
import java.util.List;

import org.airline.entity.PageBean;



/**
 * 项目名称：OrderTicketSys
 * 创   建  人：曾显圻
 * 创建时间：2011-11-9 下午02:06:31
 * 包   	名  ：org.order.dao
 * 类  名   称：IHibernateDao.java
 * 类描述: Hibernate底层接口
 */
@SuppressWarnings("all")
public interface IHibernateDao {
	
	/**
	 * 
	 * @Title: save
	 * @CodeBy: 曾显圻
	 * @Description: 持久化一个对象
	 * @return void
	 * @CreateDate 2011-11-9 下午02:09:28
	 * @throws
	 */
	public void save(Object object)throws Exception;
	
	/**
	 * 
	 * @Title: update
	 * @CodeBy: 曾显圻
	 * @Description: 更新一个对象
	 * @return void
	 * @CreateDate 2011-11-9 下午02:10:50
	 * @throws
	 */
	public void update(Object object)throws Exception;
	
	/**
	 * 
	 * @Title: updateByQuery
	 * @CodeBy: 曾显圻
	 * @Description: 根据sql语句更新对象
	 * @return void
	 * @CreateDate 2011-11-9 下午04:24:07
	 * @throws
	 */
	public void updateByQuery(String queryString,Object[] parameters)throws Exception;
	/**
	 * 
	 * @Title: delete
	 * @CodeBy: 曾显圻
	 * @Description: 删除一个对象
	 * @return void
	 * @CreateDate 2011-11-9 下午02:11:56
	 * @throws
	 */
	public void delete(Object object)throws Exception;
	
	/**
	 * 
	 * @Title: delete
	 * @CodeBy: 曾显圻
	 * @Description: 根据ID删除一个对象
	 * @return void
	 * @CreateDate 2011-11-9 下午04:09:39
	 * @throws
	 */
	public void delete(Class clazz , Serializable id)throws Exception;
	
	/**
	 * 
	 * @Title: deleteAll
	 * @CodeBy: 曾显圻
	 * @Description: 删除所有对象
	 * @return void
	 * @CreateDate 2011-11-9 下午04:14:25
	 * @throws
	 */
	public Integer deleteAll(Class clazz)throws Exception;
	
	/**
	 * 
	 * @Title: deleteByQuery
	 * @CodeBy: 曾显圻
	 * @Description: 根据传进来的sql语句与参数删除对象
	 * @return void
	 * @CreateDate 2011-11-9 下午04:22:01
	 * @throws
	 */
	public void deleteByQuery(String queryString,Object[] parameters)throws Exception;
	
	/**
	 * 
	 * @Title: get
	 * @CodeBy: 曾显圻
	 * @Description: 取得对象
	 * @return String
	 * @CreateDate 2011-11-9 下午04:27:39
	 * @throws
	 */
	public Object get(Class clazz,Serializable id)throws Exception;
	
	
	/**
	 * 
	 * @Title: get
	 * @CodeBy: 曾显圻
	 * @Description: 根据sql语句获取对象
	 * @return Object
	 * @CreateDate 2011-11-9 下午04:43:05
	 * @throws
	 */
	public Object get(String queryString,Object[] parameters)throws Exception;
	

	/**
	 * 
	 * @Title: load
	 * @CodeBy: 曾显圻
	 * @Description: 取得对象
	 * @return Object
	 * @CreateDate 2011-11-9 下午04:33:38
	 * @throws
	 */
	public Object load(Class clazz,Serializable id)throws Exception;
	
	/**
	 * 
	 * @Title: findAll
	 * @CodeBy: 曾显圻
	 * @Description: 查询所有对象
	 * @return List
	 * @CreateDate 2011-11-9 下午04:30:13
	 * @throws
	 */
	public List findAll(Class clazz)throws Exception;
	
	
	/**
	 * 
	 * @Title: findByNameQuery
	 * @CodeBy: 曾显圻
	 * @Description: 命名查询
	 * @return List
	 * @CreateDate 2011-11-10 下午12:19:45
	 * @throws
	 */
	public List findByNameQuery(String queryName)throws Exception;
	/**
	 * 
	 * @Title: findByQuery
	 * @CodeBy: 曾显圻
	 * @Description: 根据sql语句，多参数命名查询
	 * @return List
	 * @CreateDate 2011-11-9 下午04:37:19
	 * @throws
	 */
	public List findByNameQuery(String queryName,Object[] parameters)throws Exception;
	
	/**
	 * 
	 * @Title: findByNameQuery
	 * @CodeBy: 曾显圻
	 * @Description: 根据sql语句，参数命名查询
	 * @return List
	 * @CreateDate 2011-11-10 下午12:21:05
	 * @throws
	 */
	public List findByNameQuery(String queryName,Object parameters)throws Exception;
	
	/**
	 * 
	 * @Title: find
	 * @CodeBy: 曾显圻
	 * @Description: sql语句查询对象
	 * @return List
	 * @CreateDate 2011-11-10 下午12:23:19
	 * @throws
	 */
	public List find(final String queryString) throws Exception;
	
	/**
	 * 
	 * @Title: find
	 * @CodeBy: 曾显圻
	 * @Description: sql语句参数查询对象
	 * @return List
	 * @CreateDate 2011-11-10 下午12:24:30
	 * @throws
	 */
	public List find(final String queryString, final Object[] parameters)throws Exception;
	
	// 分页查询
	public List findPageByQuery(final String hql, final int offset,
			final int length) throws Exception;

	// 总记录数
	public int getAllRowCount(String hql) throws Exception;
	
	// 分页查询并返回分页Bean
	public PageBean queryForPage(String hql, int pageSize, int page) throws Exception;
	
}

